import React from 'react'
import {  TabBar } from 'antd-mobile'
import { useLocation, useNavigate } from 'react-router-dom'
import style from './index.module.css'
function Tabbar() {
    const location=useLocation()
    const pathname=location.pathname
    const setRouteActive=useNavigate()
  return (
    <div >
        <div className={style['tarbar']}>

        
      <TabBar activeKey={pathname} onChange={value => setRouteActive(value)}>
      
        <TabBar.Item key={'/home'}  title={'首页'} />
         <TabBar.Item key={'/my'}  title={'我的'} />
    </TabBar>
    </div>
    </div>
  )
}

export default Tabbar
